//该文件专门用于创建整个应用的路由器
import VueRouter from "vue-router";
import Welcome from '../pages/Welcome.vue'
import Search from '../pages/search/Search.vue'
import DownloadPage from "../pages/downloadPage/DownloadPage.vue"
import AdvSearch from "../pages/advSearch/AdvSearchPage.vue"
import AdvContent from "../pages/advSearch/AdvContent.vue"
import Settings from '../pages/settings/Settings.vue';
import Article from '../pages/article/ArticlePage.vue';

// 创建一个路由器
export default new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/welcome', // 重定向
        },
        {
            path: '/welcome',
            component: Welcome,
        },
        {
            path: '/search',
            component: Search,
            meta: {
                keepAlive: true,
            },
        },
        {
            path: '/download',
            component: DownloadPage,
        },
        {
            path: '/advSearch',
            component: AdvSearch,
            children: [
                {
                    path: '/',
                    component: AdvContent,
                    meta: {
                        keepAlive: true,
                    },
                }
            ],
            meta: {
                keepAlive: true,
            },
        },
        {
            path: '/settings',
            component: Settings,
            meta: {
            },
        },
        {
            path: '/article/:id/',
            component: Article,
            meta:{
                hasMainMenu:false, // 不需要显示主菜单
            },
        },
    ]
});